Ext.onReady(function(){ 

Ext.QuickTips.init();
Ext.form.Field.prototype.msgTarget = 'under';

var sm = new Ext.grid.CheckboxSelectionModel();
var cm=new Ext.grid.ColumnModel([ 
sm,
new Ext.grid.RowNumberer({header: "编号",width:40}),
{header:'客户编号',dataIndex:'custID',hidden:true},
{header:'客户名称',dataIndex:'custName'},
{header:'客户类型',dataIndex:'custType',width:100},
{header:'所属行业',dataIndex:'industryType',width:100},
{header:'组织形式',dataIndex:'orgType',width:100},
{header:'企业规模',dataIndex:'custScope',width:100},
{header:'建立信贷关系时间',dataIndex:'creditTime',width:100},
{header:'所属区域',dataIndex:'area',width:100},
{header:'风险暴露分类',dataIndex:'exposureType',width:100},
{header:'最新评级财报期次',dataIndex:'newestPDReportNo',width:100},
{header:'最新评级',dataIndex:'newestPD',width:100},
{header:'评级发起机构',dataIndex:'firstOrgID',width:100},
{header:'评级认定机构',dataIndex:'confirmOrgID',width:100},
{header:'评级认定时间',dataIndex:'confirmDate',width:100}
]); 
var ds=new Ext.data.Store({ 
proxy:new Ext.data.HttpProxy({
url:'RiskReport/listIRDetail.do',
method:'POST'
}), 
reader:new Ext.data.JsonReader({ },[
{name:'custID'}, 
{name:'custName'}, 
{name:'custType'},
{name:'industryType'},
{name:'orgType'},
{name:'custScope'},
{name:'creditTime'},
{name:'area'},
{name:'exposureType'},
{name:'newestPDReportNo'},
{name:'newestPD'},
{name:'firstOrgID'},
{name:'confirmOrgID'},
{name:'confirmDate'},
]) 
}); 
ds.load(); 



var grid=new Ext.grid.GridPanel({ 
	id:'IRDetailList',
	renderTo:"list", 
	stripeRows:true,//斑马线效果
	title:"非零售客户内部评级明细表", 
	height:500, 
	cm:cm,
	store: ds, 
	loadMask: { msg: "加载中..." }, 
	viewConfig: {   
	                forceFit:true   
	            },   
    bbar: new Ext.PagingToolbar({   
        pageSize: 20,   
        store: ds,   
        displayInfo: true,   
        displayMsg: '第{0} 到 {1} 条数据 共{2}条',   
        emptyMsg: "没有数据"   
    }),
    tbar:[
		{text:'导出excel',handler:exportExcel},
	] 
});

function exportExcel(){
	window.location.href='RiskReport/exportExcel.do?id=11';
};

})
